<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <script src="./js/vue-2.6.14.min.js"></script>
    <script src="./js/element-ui-2.15.6.js"></script>
    <link rel="stylesheet" href="./css/element-ui-2.15.6.css">
</head>
<body>
<div id="app">
    <el-container>
        <el-header>
            <img src="./images/logo.svg" style="margin-top: 5px; height: 40px;"/>
        </el-header>
        <el-container>
            <el-aside width="250px">
                <el-menu
                        default-active="6"
                        class="el-menu-vertical-demo"
                        @open="handleOpen"
                        @close="handleClose">

                    <el-submenu index="1">
                        <template slot="title">
                            <span>一、文件类型防御</span>
                        </template>
                        <el-menu-item-group>
                            <el-menu-item index="1-1" @click="changeFrame('view/test.html')">文件读取</el-menu-item>
                            <el-menu-item index="1-2" @click="changeFrame('view/test.html')">文件编辑</el-menu-item>
                            <el-menu-item index="1-3">文件删除</el-menu-item>
                            <el-menu-item index="1-4">文件删除</el-menu-item>
                            <el-menu-item index="1-5">目录遍历</el-menu-item>
                        </el-menu-item-group>
                    </el-submenu>

                    <el-submenu index="2">
                        <template slot="title">
                            <span>本地命令执行防御</span>
                        </template>
                        <el-menu-item-group>
                            <el-menu-item index="2-1">ProcessBuilder本地命令执行测试</el-menu-item>
                            <el-menu-item index="2-2">UNIXProcess本地命令执行测试</el-menu-item>
                        </el-menu-item-group>
                    </el-submenu>
                </el-menu>
            </el-aside>
            <el-main>
                <iframe :src="frameURL" height="100%" width="100%"></iframe>
            </el-main>
        </el-container>
    </el-container>
</div>
<script>
    new Vue({
        el: '#app',
        data: function () {
            return {
                frameURL: './view/main.html'
            }
        },
        methods: {
            handleOpen(key, keyPath) {
                console.log(key, keyPath);
            },
            handleClose(key, keyPath) {
                console.log(key, keyPath);
            },
            changeFrame(url) {
                this.frameURL = url
            }
        }
    })
</script>
</body>
<style>
    * {
        margin: 0;
        padding: 0;
    }

    .el-main {
        padding: 0;
    }

    .el-header {
        /*border: 1px #e2e2e2 solid;*/
    }

    .el-header, .el-footer {
        color: #333;
        float: left;
        height: 80px;
    }

    .el-aside {
        color: #333;
        text-align: center;
    }

    .el-aside, .el-main {
        border: 1px #e2e2e2 solid;
    }

    .el-main {
        margin-left: 10px;
        color: #333;
        text-align: center;
        /*line-height: 160px;*/
        height: calc(100vh - 60px);
    }

    iframe {
        border: 0;
    }

    .el-menu {
        border: 0;
    }

    body > .el-container {
        margin-bottom: 40px;
    }

    .el-container:nth-child(5) .el-aside,
    .el-container:nth-child(6) .el-aside {
        line-height: 260px;
    }

    .el-container:nth-child(7) .el-aside {
        line-height: 320px;
    }
</style>
</html>